package io.renren.modules.tag.controller;

import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/api")
public class CardController {

    @GetMapping("/cards")
    public List<Card> getCards() {
        List<Card> cards = new ArrayList<>();
        int i = 0;
        Card card = new Card();
        card.setTitle("自定义标签值");
        card.setDesc("自定义每个标签值的名称以及计算规则，将人群划分为多个分层");
        card.setImgUrl("https://picsum.photos/160/160?random=" + i++);
        card.setUrl("tag-customtag");
        cards.add(card);
        card = new Card();
        card.setTitle("基础指标值");
        card.setDesc("将用户完成事件的次数等指标的计算结果作为标签值");
        card.setImgUrl("https://picsum.photos/160/160?random=" + i++);
        card.setUrl("tag-basicindicator");
        cards.add(card);
        card = new Card();
        card.setTitle("行为结果分布");
        card.setDesc("将用户完成事件在指定时间段内分布的天数或小时数作为标签值");
        card.setImgUrl("https://picsum.photos/160/160?random=" + i++);
        card.setUrl("tag-behaviordistribution");
        cards.add(card);
        card = new Card();
        card.setTitle("首末次特征");
        card.setDesc("将用户首次或末次完成事件的时间、距离今日的天数或事件的属性作为标签值");
        card.setImgUrl("https://picsum.photos/160/160?random=" + i++);
        card.setUrl("tag-firstlastfeature");
        cards.add(card);
        card = new Card();
        card.setTitle("事件偏好属性");
        card.setDesc("将用户完成事件按照某个属性进行分组排序，使用排名前几个的分组作为标签值");
        card.setImgUrl("https://picsum.photos/160/160?random=" + i++);
        card.setUrl("tag-eventpreference");
        cards.add(card);
        return cards;
    }

}

@Data
class Card {

    private String title;
    private String desc;
    private String imgUrl;
    private String url;

}
